// async function fetchImg() {

//     console.log(666);

    
//     return '666';
// }

// res => console.log(res)

function timeoutPromise(interval) {

    return new Promise((resolve,reject) => {
        setTimeout(() => {
            resolve({'done':interval})
        },interval);
        
    })
}

async function testTime(interval) {
    // let promiseArr = []
    // promiseArr.length = 3;
    // promiseArr.fill(timeoutPromise(interval));
    // let result = await Promise.all(promiseArr);
    // return result;

    // 三个计时器同时开启；
    let p1 = timeoutPromise(interval);
    let p2 = timeoutPromise(interval);
    let p3 = timeoutPromise(interval);
    
    console.log(p1);
    await p1;
    console.log(p1);
    await p2;
    await p3;
}

let startTime = Date.now();
console.log('startTime',startTime);

testTime(2000).then(data => {
    let endTime = Date.now();
    console.log('endTime',endTime);
    console.log('theTimeLen:',endTime - startTime);
    console.log(data);
})

